/**
 * 
 */
package com.laozhao.deliveryManager.business;

import java.sql.SQLException;
import java.util.List;

import com.laozhao.deliveryManager.model.AbstractModel;
import com.laozhao.dreamframe.dbmanager.DBFactory;
import com.laozhao.dreamframe.dbmanager.DataBaseManager;

/**
 * @author dozhao
 *
 */
public class ComboxServer extends AbstractServer {

	/**
	 * 
	 */
	public ComboxServer() {
	}

	
	public <E extends AbstractModel> List<E> getComboxData(Class<E> E, boolean isMust) {
		DataBaseManager manager = DBFactory.getInstance();
		List<E> reList = null;
		if (!isMust) {
			reList.add(null);
		}
		try {
			manager.openConnect();
			reList.addAll( manager.getAllResult( E ) );
			manager.closeConnection();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return reList;
	}
	
	/*
	public List<MstCustomerCom> getCustomerComData(boolean mustInput){
		Connection conn = DBFactory.getInstance().openConnect();
//		StringBuffer sqlBuffer = new StringBuffer();
		String sql ;
		try {
			conn.setAutoCommit(false);
			Statement statement = conn.createStatement();
			// insert delivery main
			sql = ModelUtil.getSelStr(MstCustomerCom.class);
			
			
//			BaseInsert sel = new BaseInsert("insert INTO sys_sql ( $columnset ) values ( $valueset )",map);
//			String sql= sel.toSql();
			if (sql !=null) {
				statement.execute(sql);
			}
			conn.commit();
			conn.close();
			return null;
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	*/
}
